package org.liuyunfeng.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yanyi.util.JarResoucesUtil;

import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;

/**
 * @author: TanJingyu
 * @create: 2022-06-08 14:07
 **/
@RestController
@RequestMapping("/jar")
public class JarController {

    @GetMapping
    public Object read() throws IOException {
        InputStream read = JarResoucesUtil.read();
        if (Objects.nonNull(read)) {
            return read.available();
        }else {
            return "null";
        }
    }
}

    